﻿namespace TestTheTVDBScraper
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using TheTVDBScraper;

    [TestClass]
    public class TestSearch1
    {
        [TestMethod]
        public void TestMethod1()
        {
            TVDBScraper scraper = new TVDBScraper();
            List<TVSeries> resultsList = scraper.Search("24", "English");

            // Just process the first element i.e. TVSeries in the response
            TVSeries tvseries = resultsList.ElementAt(0);

            // Object response - Operation returns a void
            //   The base TVSeries passed in to this call is enriched
            //   with additional content so no return type is necessary
            //   simply use the TVSeries.
            scraper.GetDetailedInformation(tvseries);

            // XML Response - This call is the equivalent of
            //   GetDetailedInformation except it returns a type of string
            //   containing an xml representation of the resulting TVSeries
            string output = scraper.GetDetailedXML(tvseries);
            Console.Out.WriteLine(output);
        }
    }
}
